﻿using ProgrammingEducationSystem.Models;

namespace ProgrammingEducationSystem.Services.IServices
{
    public interface IClassesService
    {
        /// <summary>
        /// 获取班级Id
        /// </summary>
        /// <returns></returns>
        Task<Class?> GetById(Guid id);
        /// <summary>
        /// 获取所有毕业班级
        /// </summary>
        /// <returns></returns>
        Task<List<Class>?> GetByEndClass();
       
        

        /// <summary>
        /// 根据学生Id获取所有毕业班级
        /// </summary>
        /// <param name="stuId">学生Id</param>
        /// <returns></returns>
        Task<List<Class>?> GetByEndClassAndStuId(string stuId);

        /// <summary>
        /// 根据教师Id获取所有毕业班级
        /// </summary>
        /// <param name="teaId"></param>
        /// <returns></returns>
        Task<List<Class>?> GetByEndClassAndTeaId(string teaId);




        /// <summary>
        /// 查询所有班级
        /// </summary>
        /// <returns></returns>
        Task<List<Class>?> AllAsync();

        /// <summary>
        /// 查找某个老师的所有班级
        /// </summary>
        /// <returns></returns>
        Task<List<Class>?> GetByTeacherIdAsync(string id);

        /// <summary>
        /// 查找某个学生的所有班级
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        Task<List<Class>?> GetByStudentIdAsync(string id);


        /// <summary>
        /// 删除班级 ==》级联删除班级的所有学生
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task DeleteAsync(Guid Id);

        /// <summary>
        /// 删除某个老师的班级 ==》级联删除班级的所有学生
        /// </summary>
        /// <param name="Id"></param>
        /// <returns></returns>
        Task DeleteByTeacherIdAsync(string id);

        /// <summary>
        /// 新增班级
        /// </summary>
        /// <param name="class"></param>
        /// <returns></returns>
        Task AddClassAsync(Class @class);

        /// <summary>
        /// 更新班级信息
        /// </summary>
        /// <param name="class"></param>
        void UpdateAsync(Class @class);
        
        /// <summary>
        /// 保存数据库
        /// </summary>
        /// <returns></returns>
        Task<bool> SaveAsync();

    }
}
